}));
this._summaryItems = [];
+ // We keep a list of new summary items that were added to the summary since the last
+ // time it was shown to the user. We automatically show the summary to the user if there
+ // are items in this list once the notifications are done showing or once an item gets
+ // added to the summary without a notification being shown.
+ this._newSummaryItems = [];
this._longestSummaryItem = null;
},
let summaryItem = new SummaryItem(source, minTitleWidth);
this._summary.insert_actor(summaryItem.actor, 0);
- this._summaryNeedsToBeShown = true;
let newItemTitleWidth = summaryItem.getTitleNaturalWidth();
if (newItemTitleWidth > minTitleWidth) {
}
this._summaryItems.push(summaryItem);
+ this._newSummaryItems.push(summaryItem);
source.connect('notify', Lang.bind(this, this._onNotify));
this._summary.remove_actor(this._summaryItems[index].actor);
+ let newSummaryItemsIndex = this._newSummaryItems.indexOf(this._summaryItems[index]);
+ if (newSummaryItemsIndex != -1)
+ this._newSummaryItems.splice(newSummaryItemsIndex, 1);
+
this._summaryItems.splice(index, 1);
if (this._longestSummaryItem.source == source) {
let notificationsDone = !notificationsVisible && !notificationsPending;
if (this._summaryState == State.HIDDEN) {
- if (notificationsDone && this._summaryNeedsToBeShown)
+ if (notificationsDone && this._newSummaryItems.length > 0)
this._showSummary(true);
else if (summarySummoned)
this._showSummary(false);
},
_showSummaryCompleted: function(withTimeout) {
- this._summaryNeedsToBeShown = false;
+ this._newSummaryItems = [];
if (withTimeout) {
this._summaryTimeoutId =
time: ANIMATION_TIME,
transition: 'easeOutQuad'
});
- this._summaryNeedsToBeShown = false;
+ this._newSummaryItems = [];
},
_showSummaryNotification: function() {